package com.java65;

import java.util.Scanner;

public class practice5 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入整数");
        int max;//最大值
        int min;//最小值!
        int num;//录入的数据
        min=max=num = input.nextInt();
        while (num != 0) {
            if (num < min) {
                min = num;
            }
            if (num > max) {
                max = num;
            }
            System.out.println("请继续输入,输入0结束");
            num = input.nextInt();
        }
        System.out.println("最大值max=" + max + " 最小值min=" + min);
    }
  }

